<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 250px;
            height: 250px;
            margin: 100px auto;
            position: relative;
            border: 5px dashed red;
            border-radius:50% ;
            transform-style: preserve-3d;
            animation: animate 8s linear infinite;
        }
        @keyframes animate {
            0%{
                transform: rotateX(0deg) rotateY(0DEG);
            }
            100%{
                transform: rotateX(360deg) rotateY(360deg);
            }
        }
        .box>div{
            width: 100%;
            height: 100%;
            position: absolute;
            text-align: center;
            line-height: 250px;
            font-size: 60px;
            color: #666;
        }
        .left{
            background-color: rgba(255, 0, 0, 0.3);
            transform-origin: left;
            transform: rotateY(-90deg) translateX(-125px);
        }
        .right{
            background-color: rgba(0, 255, 0, 0.3);
            transform-origin: right;
            transform: rotateY(90deg) translateX(125px);
        }
        
        .up{
            background-color: rgba(255, 0, 255, 0.3);
            transform-origin: top;
            transform: rotateX(-90deg) translateY(-125px);
        }
        .down{
            background-color: rgba(255, 0, 0, 0.3);
            transform-origin: bottom;
            transform: rotateX(-90deg) translateY(125px);
        }
        .forward{
            background-color: rgba(0, 255, 0, 0.3);
            /* transform-origin: left; */
            transform:  translateZ(-125px);
        }
        .back{
            background-color: rgba(0, 0, 255, 0.3);
            /* transform-origin: left; */
            transform:  translateZ(125px);
        }
    </style>
</head>
<body>
    <div  class="box">
        <div class="up">上</div>
        <div class="down">下</div>
        <div class="left">左</div>
        <div class="right">右</div>
        <div class="forward">前</div>
        <div class="back">后</div>
    </div>
</body>
</html>